function SpTextEdit(clientName, id){
	var _instance = this;
	var _id = id;
	var _util = Library.WebControl.Util;
	var _textChanged = null;	
  _globalHashObject.Add(clientName, _instance);
  window[clientName] = _instance;	
	
	this.GetText=function(){
		return getTextControl().value;
	};
	this.GetValue=function(){
		return _instance.GetText();
	};
	this.SetText=function(t){
		getTextControl().value = t == null? "" : t;
	};
	this.SetValue=function(t){
		_instance.SetText(t);
	};	
	this.Focus=function(){
		getTextControl().focus();
	};

	function getTextControl(){
	  return _util.GetObjectById(_id);
	};
	this.Visible = function(){
		var p = getTextControl().parentNode.parentNode;
		if (arguments.length>0){
			p.style.display = arguments[0] ? "" : "none";
		}
		return p.style.display != "none";
	};
	this.Enable = function(){
		var txt = getTextControl();
		if (arguments.length >0 ) {
			_util.SetInputEnable(txt, arguments[0]);
		}
		return txt.getAttribute("readonly") != "readonly";
	}; 
	this.AddHandler = function(t, f) {
		switch(t) {
			case 1:
				_textChanged = f;
				break;
		}
	};
	this.Call = function(t, p) {
		switch(t) {
			case 1:
				if (_textChanged != null) {
					_textChanged(_instance, {});
				}	
				break;
		}
	};
};